<?php use_helper('I18N', 'Date') ?>
<?php include_partial('idea/assets') ?>
<?php use_helper('Javascript','Asset'); ?>

<div id="sf_admin_container">
  <?php include_partial('idea/flashes') ?>
  <div id="sf_admin_header">
      <div id="notification"></div>
      <div style="maring-top:2px;margin-bottom:2px">
       <?php echo periodically_call_remote(array(
      'frequency' => 30,
      'update'    => 'notification',
      'url'       => '@comment_watch',
      'with'      => "'id=' + ".(($Idea instanceof sfOutputEscaper)? $Idea->getRawValue()->getId() :$Idea->getId)."+'&count=' + jQuery('.comment_box').length",
      'complete'  => "jQuery('#comment_notification').notification( {'duration': 100, 'show-method': 'slideDown', 'hide-method': 'slideUp'} );"
      )) ?>
  </div>
  <div id="sf_admin_content">
    <fieldset class="operation_menu horizontal" id="idea_operations">
      <?php include_partial('idea/operations',array('Idea' => $Idea))?>
    </fieldset>
    <fieldset>
      <?php include_partial('idea/plain_info',array('Idea' => $Idea))?>
    </fieldset>
  </div>

  <div id="sf_admin_footer">
    <fieldset id="comments">
        <h2> <?php echo __('Comments')?> </h2>
      <div id="comment_list">
        <?php include_partial('idea/comments', array('Idea' => $Idea, 'configuration' => $configuration , 'helper' => $helper)) ?>
      </div>
      <?php include_partial('idea/comment_form', array('Idea' => $Idea, 'form' => $comment_form, 'configuration' => $configuration , 'helper' => $helper)) ?>
    </fieldset>
  </div>
</div>

<?php slot('sidebar') ?>
  <li><?php echo link_to(__('Back To main'), $helper->getUrlForAction('list'))?></li>
  <li><?php echo $helper->linkToEdit($Idea, array(  'params' =>   array(  ),  'class_suffix' => 'edit',  'label' => __('Edit idea'),))?></li>
  <li><?php echo link_to(__('Show random idea'), '@random_idea')?></li>
<?php end_slot() ?>

<?php echo javascript_tag('jQuery("#comments").toggle()')?>
